
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>银行卡提现</title>
		 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, maximum-scale=1, user-scalable=no">	
		<link rel="stylesheet" href="../css/wzl-bootstrap.css" />
		<style>
			body{
				background-color: #fff;
			}
			ul,ul.drawMoney-ul{
				padding:0;
			}
			div.col-xs-12{
				padding:0;
			}
			.drawMoney li:nth-child(2){
				
				margin-top:5px;
				margin-bottom:5px;
				border-top:1px solid #E3E3E3;
				border-bottom: 1px solid #E3E3E3;
			}
			 /*.drawMoney li{
			 	border-top:1px solid #E7E7E7;
			}*/
			.drawMoney input{
				height:40px;
				line-height:40px;
				width:66%;
				border:none;
				padding-left:5px;
				outline:none;				
			}
			.drawMoney ul li:first-child{
				margin-bottom:10px;
			}
			.drawMoney ul li:first-child span{
				font-size:13px;				
			}
			.drawMoney ul li:first-child .qiehuan{
				color:#0084FF;
				float:right;
				font-weight:normal;
				font-size:13px;
				padding-right:20px;
			}
			.drawMoney ul li span{
				font-size:16px;	
				padding-left:20px		
			}
			.drawMoney ul li:nth-child(3){
				font-size:2px;				
			}
			.drawMoney ul li:nth-child(3) b{
				color:#E4393C;
				font-weight: normal;
				margin-left:10px;
			}
			#bankinfo{
				padding-left:16px;
				border-bottom:1px solid #e3e3e3;
			}
			.pull-left{
				height:35px;
				line-height:35px;
				padding-left:20px;
			}
			.tiKuan{
				height:35px;
				width:100%;
				background-color:#e4393c;
				line-height:35px;
				text-align:center;
				color:#fff;
				border-radius:5px;
				font-size:16px;
				margin-bottom:12px;
				letter-spacing: 5px;
			}
			.tiKuan2{
				height:35px;
				width:100%;
				background-color:#c7c7c7;
				line-height:35px;
				text-align:center;

				border-radius:5px;
				font-size:16px;
				margin-bottom:12px;
				letter-spacing: 5px;
			}
			.hide { display: none; }
			input { outline: none; }
			
			/* 模拟下拉框 */
			.select { position: relative; /*margin: 50px 0 0 100px; */ width:100%;}
			.select .bankInfoList { position: absolute; top: 40px; left: 0; z-index: 20; width:100%}
			.select .bankInfoList ul { width:100%; border: 1px solid #d6d6d6; border-top: none; background-color: #fff;}
			.select .bankInfoList ul li { padding-left: 10px;  height: 40px; line-height: 40px; cursor: pointer; }
			.drawMoney .select span{
				/*margin-left:50px;*/
				color: #0084FF;
			}
			.drawMoney .select li{
				border-bottom:1px solid #e3e3e3;
			}
			.drawMoney .select li:nth-child(2){
				border-top:none;
			}
			.drawMoney .select li:last-child{
				border-bottom: none;
			}
			.drawMoney .select ul li:hover{
				backgroundColor:#fd9;font-size:18px;
			}
			.drawMoney .bankCard{
				display:inline-block;
				width:76%;
				margin-left:21px;
			}
			.drawMoney .select span.noBank{
				color:#333;
				margin-left:6px;
			}
		</style>
		<script>

//      seajs.config({
//          base:'../js/dist'
//      })
//      seajs.use('wzlh5/1.0.0/pay',function(pay){
//          pay.pay('card2cash');
//      })

    </script>
	</head>
	<body>
		<div>
			<nav class="wzl-navbar navbar-default" role="navigation" >
		        <div class="container-fluid">
		            <div class="navbar-header">
		                <div class="wzl-nav-bar" onclick="history.back(-1)">
		                    <span class="glyphicon glyphicon-wzl-back" ></span>银行卡提现
		                </div>
		            </div>
		        </div>
		    </nav>
		</div>
		
		<div class="drawMoney">			
			<div class="container-fluid">
				<div class="row">					
					<ul class="col-xs-12 drawMoney-ul">
						<li>
				            <div class="select">
							    <div class="input_in">
							       
							    </div>
							    <div class="bankInfoList hide">
							        <ul class="infoList">
							            
							        </ul>
							    </div>
							</div>
							<!--<span>工商银行(7619)</span><a href="" class="qiehuan">切换</a>-->
						</li>
						<li><span>￥</span><input type="text" placeholder="请输入提现金额" class="inputMoney"/></li>
						<li><b>提示：</b>1-3天到帐，节假日提现顺延到周一办理</li>
					</ul>
				</div>
			</div>
		</div>		
		<div class="container">
			<div class="col-xs-12">
				<!--<div class="tijiao tiKuan" onclick="tiKuan()">确定提现</div>-->
				<div class="tijiao tiKuan2">系统维护中…</div>
				<p style="font-size: 12px;">
		            <span class="wzl-text-warning" style="font-size: 14px;">温馨提示：</span><br>
		                            最低提款金额<span class="wzl-text-warning">5元</span>，收取手续费规则如下：<br>
		            1、提款金额2万（不含）元以内收取2元手续费/每笔。<br>
		            2、提款金额在2万（含）元以上，且不超过5万（不含）元收取<span class="wzl-text-warning">5元</span>手续费/每笔。<br>
		            3、提款金额在5万（含）元以上，且不超过10万（不含）元收取<span class="wzl-text-warning">10元</span>手续费/每笔。<br>
		            4、提款金额在10万（含）元以上，且不超过50万（不含）元收取<span class="wzl-text-warning">15元</span>手续费/每笔。<br>
		            5、提款金额在50万（含）元以上，且不超过100万（不含）元收取<span class="wzl-text-warning">20元</span>手续费/每笔。<br>
		            6、100万元以上按<span class="wzl-text-warning">万分之0.2</span>收取。<br>
		            7、消费金额（出票为准）不足充值金额（不含奖金）的<span class="wzl-text-warning">20%</span>，加收<span class="wzl-text-warning">10%</span>的异常提款手续费。
		            <br>
		            <span class="wzl-text-warning" style="font-size: 14px;">特别提示:&nbsp;&nbsp;</span>凡通过信用卡和快捷支付充值的不予提现		            
		        </p>
			</div>
            
		</div>		
		<script src="../js/jquery-1.8.0.min.js"></script>
		<script type="text/javascript" src="../../wzlh5/js/common.js"></script>		
		<script src="https://cdn.bootcss.com/layer/3.0.1/layer.min.js"></script>		
		
		<script>			
			window.onload=function(){
				var paramStr = {};
				paramStr.phoneNum =localStorage.getItem("phoneNum");
				var params = {};
				params.paramStr = JSON.stringify(paramStr);				
				Common.ajaxWithParam("/fenful/api/v1/common/getUserBankList", params, function(data) {		       		
		       		var html="";	
		       		var oneBankHtml="";
		       		console.log(data);
		       		
		       		for(var i=0;i<data.length;i++){
		       			data[i].bankNum=data[i].bankNum.substr(data[i].bankNum.length-4);

		       			html +="<li bankValue='"+data[i].userBankId+"'>"+data[i].bank_name+"("+data[i].bankNum+")</li>";
		       		}
		       		if(data==""){
		       			oneBankHtml='<span class="noBank">您尚未绑卡,不能提现,请先绑卡</span><a href="bindbank.html" class="qiehuan">绑卡</a>';
		       		}else{
		       			//oneBankHtml=`<div class="bankCard" bankValue=${data[0].userBankId}>${data[0].bankId}</div><span>切换</span>`;
		       			oneBankHtml="<div class='bankCard' bankValue='"+data[0].userBankId+"'>"+data[0].bank_name+"("+data[0].bankNum+")</div><span>切换</span>";
		       		}
		       		
		       		$('.input_in').html(oneBankHtml);		       		
					$('.infoList').html(html);
					Select();
				});
			}
			function Select(){
				$('.select span').on('click',function(){
		        if($('.select .bankInfoList').is('.hide')){
		            $('.select .bankInfoList').removeClass('hide');
		        }else{
		            $('.select .bankInfoList').addClass('hide');
		        }
			    })
			    $('.select ul li').on('click',function(){		    
			        $('.select .bankCard').text($(this).text());	
			        console.log($(this).attr('bankValue'));
			        $('.select .bankCard').attr("bankValue",$(this).attr('bankValue'));	
			        $('.select .bankInfoList').addClass('hide');		       
			    })

			}
             function tiKuan(){
                 var moneyReg=/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
                 var tiXianMoney=$('.inputMoney').attr('value');
                 if(tiXianMoney<5){
                     layer.msg('提现金额不能低于5元');
                 }else if(!moneyReg.test(tiXianMoney)){
                     layer.msg('请输入正确的提现金额');
                 }
                 if(moneyReg.test(tiXianMoney)&&tiXianMoney>=5){
                     var paramStr = {};
                     var phoneNum=localStorage.getItem("phoneNum");
                     var token=localStorage.getItem("token");
                     paramStr.phoneNum =phoneNum;
                     paramStr.withdraw=$('.inputMoney').attr('value');
                     paramStr.userBankId=$(".bankCard").attr('bankValue');
                     var params = {};
                     params.paramStr = JSON.stringify(paramStr);
                     console.log(params);
                     $.ajax({
                         headers: {"phone":phoneNum,"token":token},
                         type: "post",
                         data:params,
                         async: true,
                         url:'/fenful/api/v1/account/withdraw',
                         datatype: "json",
                         success: function(re) {
                             layer.msg(re.message);
                             console.log(re);

                         },
                         error: function(re) {
                             layer.msg(re.message);
                             console.log(re);
                         }
                     })
                 }
			 }
			

		</script>
	</body>
</html>
